﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace GameJamKingdom
{
    class BrickBlock:GridObject
    {
        Texture2D brickTex;
        float resistance;

        public BrickBlock(Game1 cGame)
        {
            type = "brick";
            maxPerColumn = 5;
            brickTex = cGame.Content.Load<Texture2D>("woodTile");
            resistance = 1000; // ms on average of slowdown
        }

        public override void update(GameTime cTime)
        {
            
        }

        public override void render(Rectangle cRect, SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(brickTex, cRect, Color.White);
        }

        public override bool testTime(Mode cMode, int lastTime)
        {
            if (lastTime > resistance + 200 - cMode.speed || (cMode.type.Equals("hammer") && lastTime > 200 - cMode.speed))
                return true;
            else
                return false;
        }
    }
}
